import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: resolve => require(['../components/common/Home.vue'], resolve),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/dashboard',
                    component: resolve => require(['../components/page/Dashboard.vue'], resolve),
                    meta: { title: '系统首页' }
                },
                {
                    path: '/role',
                    component: resolve => require(['../components/page/system/role.vue'], resolve),
                    meta: { title: '角色管理' }
                },
                {
                    path: '/menu',
                    component: resolve => require(['../components/page/system/menu.vue'], resolve),
                    meta: { title: '菜单管理' }
                },

                {
                    // 图片上传组件
                    path: '/updatepass',
                    component: resolve => require(['../components/page/updatepass.vue'], resolve),
                    meta: { title: '修改密码' }
                },

                {
                    path: '/manage',
                    component: resolve => require(['../components/page/system/manage.vue'], resolve),
                    meta: { title: '用户管理' }
                },


                {
                    path: '/config',
                    component: resolve => require(['../components/page/system/config.vue'], resolve),
                    meta: { title: '系统设置' }
                },
             

                {
                    path: '/404',
                    component: resolve => require(['../components/page/404.vue'], resolve),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: resolve => require(['../components/page/403.vue'], resolve),
                    meta: { title: '403', permission: true }
                }
            ]
        },
      
        {
            path: '*',
            redirect: '/404'
        }
    ]
})
